<html>
<head><meta charset="utf-8"><title>dumping sources of LLVM slowness · t-compiler/wg-self-profile · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/index.html">t-compiler/wg-self-profile</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html">dumping sources of LLVM slowness</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="176740749"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176740749" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176740749">(Sep 27 2019 at 12:24)</a>:</h4>
<p><span class="user-mention" data-user-id="124287">@mw</span> So I experimented with the CGU dumping functionality already built-in to rustc, and dumped the CGUs for librustc -- as a case study -- while in incremental mode. </p>
<p>Here are the top CGUs by number of items in them for just librustc, though post-inlining in the mono collector.</p>
<p>Do you think it'd be useful to clean this up and make it a more easily obtainable output from rustc? I could imagine us integrating it with self-profile or just dumping into a text file via -Zdump-cgus or so...</p>
<div class="codehilite"><pre><span></span>9106 rustc.c0mi9ud5-dep_graph-graph.volatile
9339 rustc_data_structures.9qcb4nu3-in-rustc_interface.f5pc1f2p-box_region.volatile
9582 rustc.c0mi9ud5-ty-query
9792 core.d2krjpsn-in-rustc_mir.34aofsg3-iter-adapters.volatile
9942 hashbrown.dxqb203g-in-rustc_typeck.6k1cg5uj-raw.volatile
11002 rustc.c0mi9ud5-in-rustc_mir.34aofsg3-ty-context.volatile
11903 rustc.c0mi9ud5-in-rustc_typeck.6k1cg5uj-ty-context.volatile
13000 rustc.c0mi9ud5-ty-context
14853 hashbrown.dxqb203g-in-rustc_mir.34aofsg3-raw.volatile
15977 alloc.3yhu0pmp-in-rustc.c0mi9ud5-raw_vec.volatile
19555 alloc.3yhu0pmp-in-rustc_mir.34aofsg3-vec.volatile
19729 core.d2krjpsn-in-rustc.c0mi9ud5-iter-adapters.volatile
26826 rustc.c0mi9ud5-ty-context.volatile
27567 alloc.3yhu0pmp-in-rustc.c0mi9ud5-vec.volatile
32196 hashbrown.dxqb203g-in-rustc.c0mi9ud5-raw.volatile
</pre></div>



<a name="176740878"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176740878" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176740878">(Sep 27 2019 at 12:26)</a>:</h4>
<p>I also don't quite understand how we get e.g. <code>hashbrown.dxqb203g-in-rustc_mir.34aofsg3-raw.volatile</code> as a codegen unit inside librustc, since it doesn't have a dependency on librustc_mir at all, so I wouldn't expect that to show up -- maybe I'm missing something though?</p>



<a name="176741155"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176741155" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176741155">(Sep 27 2019 at 12:31)</a>:</h4>
<p>This is the documented syntax</p>
<div class="codehilite"><pre><span></span>&lt;crate-name&gt;.&lt;crate-disambiguator&gt;[-in-&lt;local-crate-id&gt;](-&lt;component&gt;)*[.&lt;special-suffix&gt;]
&lt;local-crate-id&gt; = &lt;local-crate-name&gt;.&lt;local-crate-disambiguator&gt;
</pre></div>



<a name="176741271"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176741271" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176741271">(Sep 27 2019 at 12:32)</a>:</h4>
<p>So I guess one would read that as functions from hashbrown, inlined into rustc_mir due to being generic (volatile)</p>



<a name="176741341"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176741341" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176741341">(Sep 27 2019 at 12:33)</a>:</h4>
<p>oh, wait, this is not from just librustc, this is across all crates in a standard build</p>



<a name="176741352"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176741352" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176741352">(Sep 27 2019 at 12:33)</a>:</h4>
<p>This is from just librustc:</p>
<div class="codehilite"><pre><span></span>3243 arena.29va6d19-in-rustc.c0mi9ud5.volatile
4361 core.d2krjpsn-in-rustc.c0mi9ud5-slice-sort.volatile
4588 rustc.c0mi9ud5-ty-query-on_disk_cache.volatile
5275 alloc.3yhu0pmp-in-rustc.c0mi9ud5-collections-btree-node.volatile
5439 std.4uew1l7o-in-rustc.c0mi9ud5-thread-local.volatile
7962 core.d2krjpsn-in-rustc.c0mi9ud5-intrinsics.volatile
8535 rustc.c0mi9ud5-ty-query-plumbing.volatile
9106 rustc.c0mi9ud5-dep_graph-graph.volatile
9582 rustc.c0mi9ud5-ty-query
13000 rustc.c0mi9ud5-ty-context
15977 alloc.3yhu0pmp-in-rustc.c0mi9ud5-raw_vec.volatile
19729 core.d2krjpsn-in-rustc.c0mi9ud5-iter-adapters.volatile
26826 rustc.c0mi9ud5-ty-context.volatile
27567 alloc.3yhu0pmp-in-rustc.c0mi9ud5-vec.volatile
32196 hashbrown.dxqb203g-in-rustc.c0mi9ud5-raw.volatile
</pre></div>



<a name="176741922"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176741922" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176741922">(Sep 27 2019 at 12:42)</a>:</h4>
<blockquote>
<p>So I guess one would read that as functions from hashbrown, inlined into rustc_mir due to being generic (volatile)</p>
</blockquote>
<p>"instantiated in rustc_mir" would be more accurate than "inlined into rustc_mir", but otherwise that's correct, yes</p>



<a name="176741940"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176741940" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176741940">(Sep 27 2019 at 12:43)</a>:</h4>
<p>hashbrown seems to instantiate lots of generic code <code>:)</code></p>



<a name="176742058"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176742058" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176742058">(Sep 27 2019 at 12:45)</a>:</h4>
<p>Regarding your more general question: Yes, I'd like to add some kind of monomorphization tracking into self-profiling</p>



<a name="176742089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176742089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176742089">(Sep 27 2019 at 12:45)</a>:</h4>
<p>I don't know what form it would take exactly but seems very useful</p>



<a name="176742395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176742395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176742395">(Sep 27 2019 at 12:50)</a>:</h4>
<p>I guess to get a more interesting question: do we think this information is useful? How would one use it?</p>



<a name="176742404"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176742404" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176742404">(Sep 27 2019 at 12:50)</a>:</h4>
<p>cc <span class="user-mention" data-user-id="116015">@Alex Crichton</span> as well since you might be interested</p>



<a name="176742522"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176742522" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176742522">(Sep 27 2019 at 12:52)</a>:</h4>
<p>I think answering that question can help drive figuring out how to integrate</p>



<a name="176742539"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176742539" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176742539">(Sep 27 2019 at 12:52)</a>:</h4>
<p>I think it is more interesting that the function level</p>



<a name="176742553"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176742553" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176742553">(Sep 27 2019 at 12:53)</a>:</h4>
<p>also for actual inlining</p>



<a name="176742555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176742555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176742555">(Sep 27 2019 at 12:53)</a>:</h4>
<p>Sure - I have that info too</p>



<a name="176742564"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176742564" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176742564">(Sep 27 2019 at 12:53)</a>:</h4>
<p>Though that I know even less what to do with</p>



<a name="176742571"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176742571" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176742571">(Sep 27 2019 at 12:53)</a>:</h4>
<p>inlining?</p>



<a name="176742648"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176742648" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176742648">(Sep 27 2019 at 12:54)</a>:</h4>
<p>No, the functions - like, sure there's a lot of them, but it's not clear  how to act on that</p>



<a name="176742760"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176742760" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176742760">(Sep 27 2019 at 12:56)</a>:</h4>
<p>I guess if you had the actual call graph (that the collector works with) then a tool could find parts of the graph that are instantiate by a single invocation and point you to that invocation</p>



<a name="176742785"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176742785" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176742785">(Sep 27 2019 at 12:56)</a>:</h4>
<p>saying: if you turn this into a trait object, the compiler has X thousand functions less to optimize</p>



<a name="176742810"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176742810" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176742810">(Sep 27 2019 at 12:57)</a>:</h4>
<p>something like that</p>



<a name="176742821"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176742821" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176742821">(Sep 27 2019 at 12:57)</a>:</h4>
<p>Hm that would be interesting</p>



<a name="176742830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176742830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176742830">(Sep 27 2019 at 12:57)</a>:</h4>
<p>similar for function inlining</p>



<a name="176742843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176742843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176742843">(Sep 27 2019 at 12:57)</a>:</h4>
<p>a tool could tell you for each function how if it gets copied because of inlining</p>



<a name="176742856"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176742856" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176742856">(Sep 27 2019 at 12:57)</a>:</h4>
<p>Though I wonder - e.g. hashbrown can't be, right?</p>



<a name="176742863"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176742863" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176742863">(Sep 27 2019 at 12:57)</a>:</h4>
<p>and how many other inline functions get pulled into each CGU because of it</p>



<a name="176742920"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176742920" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176742920">(Sep 27 2019 at 12:58)</a>:</h4>
<blockquote>
<p>Though I wonder - e.g. hashbrown can't be, right?</p>
</blockquote>
<p>what do you mean?</p>



<a name="176742967"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176742967" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176742967">(Sep 27 2019 at 12:58)</a>:</h4>
<p>There's no way to have a non-generic hashmap</p>



<a name="176743037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176743037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176743037">(Sep 27 2019 at 12:59)</a>:</h4>
<p>true</p>



<a name="176743114"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176743114" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176743114">(Sep 27 2019 at 13:00)</a>:</h4>
<p>a tool might have to know which traits are object safe in order to give good suggestions?</p>



<a name="176743188"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176743188" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176743188">(Sep 27 2019 at 13:01)</a>:</h4>
<p>I don't know what the hashbrown code looks like, but it might still give the author an idea how to refactor things in order to have less generic code</p>



<a name="176743211"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176743211" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176743211">(Sep 27 2019 at 13:01)</a>:</h4>
<p>I guess it would be useful to know that e.g. librustc compile time is 40% hashmaps</p>



<a name="176743229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176743229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176743229">(Sep 27 2019 at 13:01)</a>:</h4>
<p>indeed :)</p>



<a name="176743257"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176743257" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176743257">(Sep 27 2019 at 13:01)</a>:</h4>
<p>it's probably also interesting to know how big these functions are</p>



<a name="176743286"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176743286" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176743286">(Sep 27 2019 at 13:02)</a>:</h4>
<p>Yeah I'm working on that</p>



<a name="176743326"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176743326" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176743326">(Sep 27 2019 at 13:02)</a>:</h4>
<p>I bet the hashbrown functions are all rather small</p>



<a name="176743391"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176743391" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176743391">(Sep 27 2019 at 13:02)</a>:</h4>
<p>It's mostly things like ManuallyDrop::deref_mut, tbh</p>



<a name="176743545"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176743545" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176743545">(Sep 27 2019 at 13:04)</a>:</h4>
<p>hm</p>



<a name="176743576"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176743576" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176743576">(Sep 27 2019 at 13:04)</a>:</h4>
<p>I wonder how much of that is left after LLVM has done inlining and function merging</p>



<a name="176743691"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176743691" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176743691">(Sep 27 2019 at 13:06)</a>:</h4>
<p>probably very little -- but that takes time</p>



<a name="176743847"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176743847" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176743847">(Sep 27 2019 at 13:08)</a>:</h4>
<p>is this for a debug or a release build</p>



<a name="176743882"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176743882" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176743882">(Sep 27 2019 at 13:08)</a>:</h4>
<p>I think we are a lot more aggressive about duplicating code for release builds</p>



<a name="176743904"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176743904" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176743904">(Sep 27 2019 at 13:08)</a>:</h4>
<p>release build</p>



<a name="176743923"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176743923" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176743923">(Sep 27 2019 at 13:08)</a>:</h4>
<p>(this is literally just an x.py build with some dumping built in)</p>



<a name="176743926"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176743926" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176743926">(Sep 27 2019 at 13:08)</a>:</h4>
<p>inline functions are treated differently and -Zshare-generics is on by default for debug builds</p>



<a name="176744362"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176744362" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176744362">(Sep 27 2019 at 13:14)</a>:</h4>
<p>I wonder if it's worth trying to run this with -Zshare-generics in release mode, if that's a big win compile time and not a big loss at runtime it might be worth considering</p>



<a name="176744809"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176744809" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176744809">(Sep 27 2019 at 13:21)</a>:</h4>
<p>Seems worth benchmarking, yes</p>



<a name="176744911"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176744911" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176744911">(Sep 27 2019 at 13:22)</a>:</h4>
<p>I'll try to allocate some time to a PR that does that to run it through perf</p>



<a name="176745580"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176745580" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176745580">(Sep 27 2019 at 13:31)</a>:</h4>
<p>oof</p>
<div class="codehilite"><pre><span></span>1664 stmts for fn syntax::visit[0]::walk_expr[0]&lt;syntax::util[0]::node_count[0]::NodeCounter[0]&gt;
1791 stmts for fn syntax::parse[0]::parser[0]::ty[0]::{{impl}}[0]::parse_ty_common[0]
1832 stmts for fn syntax::print[0]::pprust[0]::{{impl}}[5]::print_item[0]
2073 stmts for fn syntax::ast[0]::{{impl}}[255]::fmt[0]
2073 stmts for fn syntax::print[0]::pprust[0]::{{impl}}[5]::print_expr_outer_attr_style[0]
2225 stmts for fn syntax::parse[0]::parser[0]::expr[0]::{{impl}}[2]::parse_bottom_expr[0]
2241 stmts for fn syntax::feature_gate[0]::check[0]::{{impl}}[0]::check_abi[0]
2738 stmts for fn syntax::feature_gate[0]::check[0]::{{impl}}[1]::visit_item[0]
3868 stmts for fn syntax::parse[0]::parser[0]::item[0]::{{impl}}[0]::parse_item_implementation[0]
4183 stmts for fn proc_macro::bridge[0]::server[0]::{{impl}}[18]::dispatch[0]&lt;syntax::ext[0]::proc_macro_server[0]::Rustc[0]&gt;
</pre></div>


<div class="codehilite"><pre><span></span>3240 stmts for fn rustc::ty[0]::query[0]::{{impl}}[0]::print_stats[0]
4007 stmts for fn rustc::ty[0]::query[0]::plumbing[0]::force_from_dep_node[0]
4744 stmts for fn rustc::ty[0]::layout[0]::{{impl}}[3]::layout_raw_uncached[0]
5092 stmts for fn rustc::ty[0]::context[0]::{{impl}}[14]::print_debug_stats[0]::inner[0]::go[0]
5685 stmts for fn rustc::ty[0]::print[0]::pretty[0]::PrettyPrinter[0]::pretty_print_type[0]&lt;rustc::ty[0]::print[0]::pretty[0]::FmtPrinter[0]&lt;&amp;mut alloc::string[0]::String[0]&gt;&gt;
5685 stmts for fn rustc::ty[0]::print[0]::pretty[0]::PrettyPrinter[0]::pretty_print_type[0]&lt;rustc::ty[0]::print[0]::pretty[0]::FmtPrinter[0]&lt;&amp;mut core::fmt[0]::Formatter[0]&gt;&gt;
6501 stmts for fn rustc::ty[0]::query[0]::{{impl}}[401]::fmt[0]
16401 stmts for fn rustc::dep_graph[0]::dep_node[0]::{{impl}}[14]::new[0]
16401 stmts for fn rustc::dep_graph[0]::dep_node[0]::{{impl}}[14]::new[0]
16401 stmts for fn rustc::dep_graph[0]::dep_node[0]::{{impl}}[14]::new[0]
</pre></div>



<a name="176745602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176745602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176745602">(Sep 27 2019 at 13:31)</a>:</h4>
<p>in particular those 16,000 statement long new functions are a bit sad to see duplicated</p>



<a name="176746358"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176746358" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176746358">(Sep 27 2019 at 13:41)</a>:</h4>
<p><span class="user-mention" data-user-id="124287">@mw</span> is there any point in us generating empty functions? At least size_estimate is 0... maybe that's not entirely accurate?</p>



<a name="176746375"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176746375" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176746375">(Sep 27 2019 at 13:41)</a>:</h4>
<p>e.g. I get a lot of:</p>
<div class="codehilite"><pre><span></span>0 stmts for fn core::ptr[0]::real_drop_in_place[0]&lt;&amp;u64&gt;
0 stmts for fn core::mem[0]::needs_drop[0]&lt;(syntax_pos::SpanData[0], u32)&gt;
0 stmts for fn core::ptr[0]::real_drop_in_place[0]&lt;hashbrown::map[0]::HashMap[0]&lt;syntax_pos::SpanData[0], u32, core::hash[0]::BuildHasherDefault[0]&lt;rustc_hash::FxHasher[0]&gt;&gt;&gt;
0 stmts for fn core::mem[0]::align_of[0]&lt;(&amp;str, syntax_pos::symbol[0]::Symbol[0])&gt;
0 stmts for fn core::mem[0]::size_of[0]&lt;syntax_pos::SpanLabel[0]&gt;
0 stmts for fn core::ptr[0]::real_drop_in_place[0]&lt;&amp;bool&gt;
0 stmts for fn core::mem[0]::size_of[0]&lt;(&amp;str, syntax_pos::symbol[0]::Symbol[0])&gt;
0 stmts for fn core::hint[0]::unreachable_unchecked[0]
0 stmts for fn core::ptr[0]::real_drop_in_place[0]&lt;&amp;alloc::vec[0]::Vec[0]&lt;(syntax_pos::span_encoding[0]::Span[0], alloc::string[0]::String[0])&gt;&gt;
0 stmts for fn hashbrown::raw[0]::{{impl}}[5]::free_buckets[0]::{{closure}}[0]&lt;((syntax_pos::hygiene[0]::SyntaxContext[0], syntax_pos::hygiene[0]::ExpnId[0], syntax_pos::hygien
0 stmts for fn core::ptr[0]::real_drop_in_place[0]&lt;syntax_pos::hygiene[0]::HygieneData[0]&gt;
0 stmts for fn core::ptr[0]::real_drop_in_place[0]&lt;std::path[0]::PathBuf[0]&gt;
0 stmts for fn core::ptr[0]::real_drop_in_place[0]&lt;std::collections[0]::hash[0]::map[0]::HashMap[0]&lt;(syntax_pos::hygiene[0]::SyntaxContext[0], syntax_pos::hygiene[0]::ExpnId[0]
0 stmts for fn core::ptr[0]::real_drop_in_place[0]&lt;&amp;u8&gt;
0 stmts for fn core::ptr[0]::real_drop_in_place[0]&lt;std::ffi[0]::os_str[0]::OsString[0]&gt;
0 stmts for fn core::ptr[0]::real_drop_in_place[0]&lt;std::collections[0]::hash[0]::map[0]::HashMap[0]&lt;syntax_pos::SpanData[0], u32, core::hash[0]::BuildHasherDefault[0]&lt;rustc_has
0 stmts for fn core::mem[0]::size_of[0]&lt;u8&gt;
0 stmts for fn core::ptr[0]::real_drop_in_place[0]&lt;std::collections[0]::hash[0]::map[0]::HashMap[0]&lt;&amp;str, syntax_pos::symbol[0]::Symbol[0], core::hash[0]::BuildHasherDefault[0]
0 stmts for fn core::slice[0]::size_from_ptr[0]&lt;syntax_pos::span_encoding[0]::Span[0]&gt;
0 stmts for fn core::mem[0]::size_of[0]&lt;(syntax_pos::span_encoding[0]::Span[0], alloc::string[0]::String[0])&gt;
0 stmts for fn core::ptr[0]::real_drop_in_place[0]&lt;&amp;syntax_pos::FileName[0]&gt;
0 stmts for fn hashbrown::raw[0]::{{impl}}[5]::free_buckets[0]::{{closure}}[0]&lt;(syntax_pos::SpanData[0], u32), i32, extern &quot;rust-call&quot; fn(()) -&gt; (core::alloc[0]::Layout[0], usi
0 stmts for fn core::mem[0]::size_of[0]&lt;((syntax_pos::hygiene[0]::SyntaxContext[0], syntax_pos::hygiene[0]::ExpnId[0], syntax_pos::hygiene[0]::Transparency[0]), syntax_pos::hyg
0 stmts for fn core::slice[0]::size_from_ptr[0]&lt;syntax_pos::SpanLabel[0]&gt;
0 stmts for fn core::ptr[0]::real_drop_in_place[0]&lt;syntax_pos::symbol[0]::Interner[0]&gt;
0 stmts for fn core::ptr[0]::real_drop_in_place[0]&lt;&amp;std::path[0]::PathBuf[0]&gt;
0 stmts for fn core::ptr[0]::real_drop_in_place[0]&lt;arena::DroplessArena[0]&gt;
0 stmts for fn core::ptr[0]::real_drop_in_place[0]&lt;core::cell[0]::UnsafeCell[0]&lt;syntax_pos::symbol[0]::Interner[0]&gt;&gt;
0 stmts for fn core::ptr[0]::real_drop_in_place[0]&lt;syntax_pos::BytePos[0]&gt;
0 stmts for fn core::ptr[0]::real_drop_in_place[0]&lt;core::cell[0]::RefCell[0]&lt;syntax_pos::span_encoding[0]::SpanInterner[0]&gt;&gt;
0 stmts for fn core::ptr[0]::real_drop_in_place[0]&lt;&amp;alloc::rc[0]::Rc[0]&lt;syntax_pos::SourceFile[0]&gt;&gt;
0 stmts for fn core::ptr[0]::real_drop_in_place[0]&lt;core::cell[0]::UnsafeCell[0]&lt;syntax_pos::hygiene[0]::HygieneData[0]&gt;&gt;
0 stmts for fn core::ptr[0]::real_drop_in_place[0]&lt;&amp;alloc::vec[0]::Vec[0]&lt;syntax_pos::span_encoding[0]::Span[0]&gt;&gt;
0 stmts for fn core::ptr[0]::real_drop_in_place[0]&lt;&amp;syntax_pos::BytePos[0]&gt;
0 stmts for fn core::ptr[0]::real_drop_in_place[0]&lt;core::cell[0]::BorrowMutError[0]&gt;
0 stmts for fn core::mem[0]::size_of[0]&lt;syntax_pos::span_encoding[0]::Span[0]&gt;
0 stmts for fn core::mem[0]::align_of[0]&lt;(syntax_pos::SpanData[0], u32)&gt;
</pre></div>



<a name="176748476"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176748476" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176748476">(Sep 27 2019 at 14:04)</a>:</h4>
<p>I don't remember how the size estimate is done. it might not be reliable</p>



<a name="176750714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176750714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176750714">(Sep 27 2019 at 14:27)</a>:</h4>
<p>this does seem like very interesting data to me! I suspect that hashbrown is generating so much because it seems literally all functions in the crate are <code>#[inline]</code>...</p>



<a name="176750871"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176750871" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176750871">(Sep 27 2019 at 14:28)</a>:</h4>
<p>maybe not all of them need to be? the majority of the code seems to be generic though</p>



<a name="176750919"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176750919" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176750919">(Sep 27 2019 at 14:29)</a>:</h4>
<p>yup...</p>



<a name="176750920"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176750920" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176750920">(Sep 27 2019 at 14:29)</a>:</h4>
<p>i.e. if it ends up in the <code>volatile</code> CGU, it means that it is not inline</p>



<a name="176750960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176750960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176750960">(Sep 27 2019 at 14:29)</a>:</h4>
<p>hm what would end up in the <code>volatile</code> CGU?</p>



<a name="176750963"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176750963" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176750963">(Sep 27 2019 at 14:29)</a>:</h4>
<p>or maybe it is inline and pulled in by something not inline :)</p>



<a name="176750967"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176750967" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176750967">(Sep 27 2019 at 14:29)</a>:</h4>
<p>just generics w/o <code>#{inline]</code>?</p>



<a name="176750973"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176750973" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176750973">(Sep 27 2019 at 14:29)</a>:</h4>
<p>yes</p>



<a name="176750986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176750986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176750986">(Sep 27 2019 at 14:29)</a>:</h4>
<p>and everything inline they pull in</p>



<a name="176751071"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176751071" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176751071">(Sep 27 2019 at 14:30)</a>:</h4>
<p>that's... probably a lot</p>



<a name="176751091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176751091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176751091">(Sep 27 2019 at 14:30)</a>:</h4>
<p>we did indeed measure compile time slowdown on perf benchmarks b/c of hashbrown</p>



<a name="176754417"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176754417" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176754417">(Sep 27 2019 at 15:05)</a>:</h4>
<p>and interesting question is: what kind of tool would help improving the situation here?</p>



<a name="176754555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176754555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176754555">(Sep 27 2019 at 15:06)</a>:</h4>
<p>/me goes crazy and thinks about profile-guided CGU partitioning <span aria-label="smiley" class="emoji emoji-1f603" role="img" title="smiley">:smiley:</span> <span aria-label="explosion" class="emoji emoji-1f4a5" role="img" title="explosion">:explosion:</span></p>



<a name="176754691"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176754691" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176754691">(Sep 27 2019 at 15:08)</a>:</h4>
<blockquote>
<p>/me goes crazy and thinks about profile-guided CGU partitioning <span aria-label="smiley" class="emoji emoji-1f603" role="img" title="smiley">:smiley:</span> <span aria-label="explosion" class="emoji emoji-1f4a5" role="img" title="explosion">:explosion:</span></p>
</blockquote>
<p>Although I'm not sure this makes sense. All the information is also available at compile time ??</p>



<a name="176755262"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176755262" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176755262">(Sep 27 2019 at 15:15)</a>:</h4>
<p>I've posted <a href="https://github.com/rust-lang/rust/pull/64846" target="_blank" title="https://github.com/rust-lang/rust/pull/64846">https://github.com/rust-lang/rust/pull/64846</a> to investigate what happens if we remove <code>#[inline]</code> from hashbrown</p>



<a name="176755279"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176755279" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176755279">(Sep 27 2019 at 15:15)</a>:</h4>
<p>it could also just very well be the case that hashbrown has a lot more code</p>



<a name="176756857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176756857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176756857">(Sep 27 2019 at 15:31)</a>:</h4>
<p><span class="user-mention" data-user-id="116015">@Alex Crichton</span> Yeah, hashbrown today compiles to the following in a standalone sense</p>
<div class="codehilite"><pre><span></span>POST INLINING:
CodegenUnit hashbrown.dxqb203g-cgu.0 (3 items):
0 stmts for fn core::ptr[0]::real_drop_in_place[0]&lt;&amp;core::alloc[0]::Layout[0]&gt;
9 stmts for fn core::fmt[0]::{{impl}}[47]::fmt[0]&lt;core::alloc[0]::Layout[0]&gt;
61 stmts for fn hashbrown::{{impl}}[0]::fmt[0]
</pre></div>



<a name="176759050"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176759050" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176759050">(Sep 27 2019 at 15:55)</a>:</h4>
<p>Top 15 functions by our size_estimate across all of rust-lang/rust pretty much (not including tools):</p>
<div class="codehilite"><pre><span></span>total    # of copies   per copy size
278817   17            16401           rustc::dep_graph[0]::dep_node[0]::{{impl}}[14]::new[0]
177814   977           182             core::ptr[0]::swap_nonoverlapping_bytes[0]
85560    1240          69              core::intrinsics[0]::copy_nonoverlapping[0]&lt;u8&gt;
70180    605           116             hashbrown::raw[0]::imp[0]::{{impl}}[0]::load_aligned[0]
62370    462           135             core::alloc[0]::{{impl}}[0]::extend[0]
61920    180           344             core::char[0]::methods[0]::{{impl}}[0]::encode_utf8[0]
51072    532           96              core::alloc[0]::{{impl}}[0]::repeat[0]
44826    1446          31              core::num[0]::{{impl}}[17]::overflowing_mul[0]
33258    1446          23              core::num[0]::{{impl}}[17]::checked_mul[0]
31360    490           64              core::core_arch[0]::simd[0]::{{impl}}[95]::new[0]
31070    26            1195            rustc::dep_graph[0]::dep_node[0]::{{impl}}[13]::can_reconstruct_query_key[0]
29988    588           51              core::alloc[0]::{{impl}}[0]::from_size_align[0]
29951    491           61              rustc::hir[0]::def_id[0]::{{impl}}[36]::eq[0]
29187    423           69              core::intrinsics[0]::copy_nonoverlapping[0]&lt;usize&gt;
26505    855           31              core::num[0]::{{impl}}[17]::overflowing_add[0]
</pre></div>



<a name="176759148"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176759148" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176759148">(Sep 27 2019 at 15:56)</a>:</h4>
<p>Some of these are really a bit sad to see so high up, though others mostly make sense</p>



<a name="176759297"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176759297" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176759297">(Sep 27 2019 at 15:58)</a>:</h4>
<p><span class="user-mention" data-user-id="116015">@Alex Crichton</span> filtering all instantiations down to just hashbrown I see </p>
<div class="codehilite"><pre><span></span>total   # of copies   per copy size
70180   605           116             hashbrown::raw[0]::imp[0]::{{impl}}[0]::load_aligned[0]
18816   84            224             hashbrown::raw[0]::{{impl}}[11]::new[0]&lt;(&amp;rustc::ty[0]::sty[0]::RegionKind[0]
18468   486           38              hashbrown::raw[0]::{{impl}}[1]::next[0]
17696   79            224             hashbrown::raw[0]::{{impl}}[11]::new[0]&lt;(rustc::hir[0]::item_local_id_inner[0]::ItemLocalId[0]
16800   75            224             hashbrown::raw[0]::{{impl}}[11]::new[0]&lt;(rustc::ty[0]::UpvarId[0]
16800   75            224             hashbrown::raw[0]::{{impl}}[11]::new[0]&lt;(rustc::hir[0]::item_local_id_inner[0]::ItemLocalId[0]
16800   75            224             hashbrown::raw[0]::{{impl}}[11]::new[0]&lt;(rustc::hir[0]::item_local_id_inner[0]::ItemLocalId[0]
16800   75            224             hashbrown::raw[0]::{{impl}}[11]::new[0]&lt;(rustc::hir[0]::item_local_id_inner[0]::ItemLocalId[0]
16800   75            224             hashbrown::raw[0]::{{impl}}[11]::new[0]&lt;(rustc::hir[0]::item_local_id_inner[0]::ItemLocalId[0]
16800   75            224             hashbrown::raw[0]::{{impl}}[11]::new[0]&lt;(rustc::hir[0]::def_id[0]::DefId[0]
16576   74            224             hashbrown::raw[0]::{{impl}}[11]::new[0]&lt;(rustc::hir[0]::item_local_id_inner[0]::ItemLocalId[0]
16576   74            224             hashbrown::raw[0]::{{impl}}[11]::new[0]&lt;(rustc::hir[0]::item_local_id_inner[0]::ItemLocalId[0]
16576   74            224             hashbrown::raw[0]::{{impl}}[11]::new[0]&lt;(rustc::hir[0]::item_local_id_inner[0]::ItemLocalId[0]
16576   74            224             hashbrown::raw[0]::{{impl}}[11]::new[0]&lt;(rustc::hir[0]::item_local_id_inner[0]::ItemLocalId[0]
16576   74            224             hashbrown::raw[0]::{{impl}}[11]::new[0]&lt;(rustc::hir[0]::item_local_id_inner[0]::ItemLocalId[0]
</pre></div>



<a name="176759341"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176759341" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176759341">(Sep 27 2019 at 15:59)</a>:</h4>
<p>I guess most of those have their "values" cut off -- but still</p>



<a name="176759385"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176759385" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176759385">(Sep 27 2019 at 15:59)</a>:</h4>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span> what does that mean # of copies?</p>



<a name="176759399"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176759399" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176759399">(Sep 27 2019 at 15:59)</a>:</h4>
<p>is this for one rustc crate or the whole crate graph?</p>



<a name="176759455"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176759455" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176759455">(Sep 27 2019 at 16:00)</a>:</h4>
<p>whole crate graph</p>



<a name="176759458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176759458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176759458">(Sep 27 2019 at 16:00)</a>:</h4>
<p>do you perhaps have a compiler with debug assertions enabled?</p>



<a name="176759475"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176759475" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176759475">(Sep 27 2019 at 16:00)</a>:</h4>
<p>yeah, I do</p>



<a name="176759485"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176759485" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176759485">(Sep 27 2019 at 16:00)</a>:</h4>
<p>so <code>load_aligned</code> was instantiated 605 times?</p>



<a name="176759496"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176759496" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176759496">(Sep 27 2019 at 16:00)</a>:</h4>
<p>across the whole crate graph (std, rustc, test, codegen, etc)</p>



<a name="176759516"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176759516" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176759516">(Sep 27 2019 at 16:00)</a>:</h4>
<p>this'd be why it's so expensive -- <a href="https://github.com/rust-lang/hashbrown/blob/d1ad4fc3aae2ade446738eea512e50b9e863dd0c/src/raw/sse2.rs#L57" target="_blank" title="https://github.com/rust-lang/hashbrown/blob/d1ad4fc3aae2ade446738eea512e50b9e863dd0c/src/raw/sse2.rs#L57">https://github.com/rust-lang/hashbrown/blob/d1ad4fc3aae2ade446738eea512e50b9e863dd0c/src/raw/sse2.rs#L57</a></p>



<a name="176759542"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176759542" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176759542">(Sep 27 2019 at 16:01)</a>:</h4>
<p>but nice data!</p>



<a name="176759561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176759561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176759561">(Sep 27 2019 at 16:01)</a>:</h4>
<p><code>hashbrown::raw[0]::{{impl}}[1]::next[0]</code> &lt;- how would I interpret that?</p>



<a name="176759577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176759577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176759577">(Sep 27 2019 at 16:01)</a>:</h4>
<p>I believe that's the next function in the 2nd impl in the raw module</p>



<a name="176759582"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176759582" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176759582">(Sep 27 2019 at 16:01)</a>:</h4>
<p>probably an Iterator?</p>



<a name="176759638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176759638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176759638">(Sep 27 2019 at 16:02)</a>:</h4>
<p>ok cool</p>



<a name="176759664"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176759664" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176759664">(Sep 27 2019 at 16:02)</a>:</h4>
<p>looks like this in that case -- <a href="https://github.com/rust-lang/hashbrown/blob/d1ad4fc3aae2ade446738eea512e50b9e863dd0c/src/raw/mod.rs#L1185-L1208" target="_blank" title="https://github.com/rust-lang/hashbrown/blob/d1ad4fc3aae2ade446738eea512e50b9e863dd0c/src/raw/mod.rs#L1185-L1208">https://github.com/rust-lang/hashbrown/blob/d1ad4fc3aae2ade446738eea512e50b9e863dd0c/src/raw/mod.rs#L1185-L1208</a></p>



<a name="176759688"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176759688" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176759688">(Sep 27 2019 at 16:02)</a>:</h4>
<p>which makes sense</p>



<a name="176759731"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176759731" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176759731">(Sep 27 2019 at 16:03)</a>:</h4>
<p>not sure why that has 486 copies...</p>



<a name="176759751"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176759751" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176759751">(Sep 27 2019 at 16:03)</a>:</h4>
<p>well, it's probably getting instantiated in every single module ever pretty much inside the compiler</p>



<a name="176759755"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176759755" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176759755">(Sep 27 2019 at 16:03)</a>:</h4>
<p>FWIW building libstd with debug assertions, I think all bets are off in terms of compile time</p>



<a name="176759772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176759772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176759772">(Sep 27 2019 at 16:03)</a>:</h4>
<p>like even <em>really</em> core things like <code>ptr</code> and <code>mem</code> methods have debug assertions</p>



<a name="176759777"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176759777" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176759777">(Sep 27 2019 at 16:03)</a>:</h4>
<p>Is there a way to disable debug asserts for std but enable them for the compiler?</p>



<a name="176759789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176759789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176759789">(Sep 27 2019 at 16:03)</a>:</h4>
<p>not currently</p>



<a name="176759799"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176759799" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176759799">(Sep 27 2019 at 16:03)</a>:</h4>
<p>or at least not that I know of</p>



<a name="176759813"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176759813" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176759813">(Sep 27 2019 at 16:04)</a>:</h4>
<p>we should probably expose that tbh</p>



<a name="176759915"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176759915" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176759915">(Sep 27 2019 at 16:05)</a>:</h4>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span> do you have a branch w/ this data collection I could poke at?</p>



<a name="176759924"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176759924" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176759924">(Sep 27 2019 at 16:05)</a>:</h4>
<p>I'd be curious if I can get info out of cargo</p>



<a name="176759931"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176759931" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176759931">(Sep 27 2019 at 16:05)</a>:</h4>
<p>yeah, give me one moment to push it up</p>



<a name="176760031"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176760031" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176760031">(Sep 27 2019 at 16:06)</a>:</h4>
<p><span class="user-mention" data-user-id="116015">@Alex Crichton</span> <a href="https://github.com/Mark-Simulacrum/rust/tree/dump-codegen" target="_blank" title="https://github.com/Mark-Simulacrum/rust/tree/dump-codegen">https://github.com/Mark-Simulacrum/rust/tree/dump-codegen</a> -- you probably want just the first commit</p>



<a name="176760054"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176760054" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176760054">(Sep 27 2019 at 16:06)</a>:</h4>
<p>I currently have it setup to just dump to /tmp/cg-dumps/{crate name}/{label} if debug asserts are on for all crates</p>



<a name="176760110"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176760110" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176760110">(Sep 27 2019 at 16:07)</a>:</h4>
<p>ah so this isn't actually instrumenting llvm</p>



<a name="176760113"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176760113" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176760113">(Sep 27 2019 at 16:07)</a>:</h4>
<p>it's just using a size estimate</p>



<a name="176760118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176760118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176760118">(Sep 27 2019 at 16:07)</a>:</h4>
<p>right, yeah</p>



<a name="176760173"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176760173" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176760173">(Sep 27 2019 at 16:08)</a>:</h4>
<p>RUSTFLAGS_NOT_BOOTSTRAP="-Zhuman-readable-cgu-names" is also somewhat helpful to figure out where things are being emitted</p>



<a name="176760210"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176760210" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176760210">(Sep 27 2019 at 16:08)</a>:</h4>
<p>but I believe this size estimate has a pretty good correspondence  with what we end up codegen'ing -- some constant factor</p>



<a name="176760272"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176760272" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176760272">(Sep 27 2019 at 16:09)</a>:</h4>
<p>I think it'd be feasible to do some more low-level instrumentation of LLVM but I jumped on the fact that we already had this infra mostly in place on master</p>



<a name="176760290"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176760290" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176760290">(Sep 27 2019 at 16:09)</a>:</h4>
<p>i.e., the function was hooked up and such</p>



<a name="176760443"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176760443" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176760443">(Sep 27 2019 at 16:11)</a>:</h4>
<div class="codehilite"><pre><span></span>cat /tmp/cg-dumps/*/POST_INLINING\:.codegen-units | rg &#39;stmts for&#39; | sort -n -k1 --parallel=8 | uniq -c &gt; /tmp/st
(printf &#39;total, # of copies, per copy size\n&#39;; (rg hashbrown /tmp/st | awk &#39;{ print $1*$2 &quot;, &quot; $1 &quot;, &quot; $2 &quot;, &quot; $6 }&#39; | sort -rn -k1 | head -n15)) | column -t -s,
# or
(printf &#39;total, # of copies, per copy size\n&#39;; (awk &#39;{ print $1*$2 &quot;, &quot; $1 &quot;, &quot; $2 &quot;, &quot; $0 }&#39; /tmp/st | sort -rn -k1 | head -n15)) | column -t -s,
</pre></div>



<a name="176760451"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176760451" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176760451">(Sep 27 2019 at 16:11)</a>:</h4>
<p>those are the 2 commands I've been using to get that chart output</p>



<a name="176760550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176760550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176760550">(Sep 27 2019 at 16:12)</a>:</h4>
<p>if in non-incremental mode you probably want POST_MERGING instead of POST_INLINING, since we merge into 16 codegen units then or so</p>



<a name="176761609"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176761609" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176761609">(Sep 27 2019 at 16:26)</a>:</h4>
<p>fixed the cutting of the values etc</p>
<div class="codehilite"><pre><span></span>total, # of copies, per copy size
69575                               605   115       605 115 stmts for fn hashbrown::raw[0]::imp[0]::{{impl}}[0]::load_aligned[0]
18816                               84    224        84 224 stmts for fn hashbrown::raw[0]::{{impl}}[11]::new[0]&lt;(&amp;rustc::ty[0]::sty[0]::RegionKind[0], rustc_data_structures::transitive_relation[0]::Index[0])&gt;
17696                               79    224        79 224 stmts for fn hashbrown::raw[0]::{{impl}}[11]::new[0]&lt;(rustc::hir[0]::item_local_id_inner[0]::ItemLocalId[0], ())&gt;
17496                               486   36        486 36 stmts for fn hashbrown::raw[0]::{{impl}}[1]::next[0]
16800                               75    224        75 224 stmts for fn hashbrown::raw[0]::{{impl}}[11]::new[0]&lt;(rustc::ty[0]::UpvarId[0], rustc::ty[0]::UpvarCapture[0])&gt;
16800                               75    224        75 224 stmts for fn hashbrown::raw[0]::{{impl}}[11]::new[0]&lt;(rustc::hir[0]::item_local_id_inner[0]::ItemLocalId[0], rustc::ty[0]::sty[0]::FnSig[0])&gt;
16800                               75    224        75 224 stmts for fn hashbrown::raw[0]::{{impl}}[11]::new[0]&lt;(rustc::hir[0]::item_local_id_inner[0]::ItemLocalId[0], rustc::infer[0]::canonical[0]::Canonical[0]&lt;rustc::ty[0]::context[0]::UserType[0]&gt;)&gt;
16800                               75    224        75 224 stmts for fn hashbrown::raw[0]::{{impl}}[11]::new[0]&lt;(rustc::hir[0]::item_local_id_inner[0]::ItemLocalId[0], alloc::vec[0]::Vec[0]&lt;&amp;rustc::ty[0]::TyS[0]&gt;)&gt;
16800                               75    224        75 224 stmts for fn hashbrown::raw[0]::{{impl}}[11]::new[0]&lt;(rustc::hir[0]::item_local_id_inner[0]::ItemLocalId[0], (syntax_pos::span_encoding[0]::Span[0], syntax_pos::symbol[0]::Symbol[0]))&gt;
16800                               75    224        75 224 stmts for fn hashbrown::raw[0]::{{impl}}[11]::new[0]&lt;(rustc::hir[0]::def_id[0]::DefId[0], rustc::infer[0]::canonical[0]::Canonical[0]&lt;rustc::ty[0]::sty[0]::Binder[0]&lt;rustc::ty[0]::sty[0]::FnSig[0]&gt;&gt;)&gt;
16576                               74    224        74 224 stmts for fn hashbrown::raw[0]::{{impl}}[11]::new[0]&lt;(rustc::hir[0]::item_local_id_inner[0]::ItemLocalId[0], usize)&gt;
16576                               74    224        74 224 stmts for fn hashbrown::raw[0]::{{impl}}[11]::new[0]&lt;(rustc::hir[0]::item_local_id_inner[0]::ItemLocalId[0], rustc::ty[0]::binding[0]::BindingMode[0])&gt;
16576                               74    224        74 224 stmts for fn hashbrown::raw[0]::{{impl}}[11]::new[0]&lt;(rustc::hir[0]::item_local_id_inner[0]::ItemLocalId[0], core::result[0]::Result[0]&lt;(rustc::hir[0]::def[0]::DefKind[0], rustc::hir[0]::def_id[0]::DefId[0]), rustc::util[0]::common[0]::ErrorReported[0]&gt;)&gt;
16576                               74    224        74 224 stmts for fn hashbrown::raw[0]::{{impl}}[11]::new[0]&lt;(rustc::hir[0]::item_local_id_inner[0]::ItemLocalId[0], alloc::vec[0]::Vec[0]&lt;rustc::ty[0]::adjustment[0]::Adjustment[0]&gt;)&gt;
16576                               74    224        74 224 stmts for fn hashbrown::raw[0]::{{impl}}[11]::new[0]&lt;(rustc::hir[0]::item_local_id_inner[0]::ItemLocalId[0], &amp;rustc::ty[0]::TyS[0])&gt;
</pre></div>



<a name="176761677"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176761677" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176761677">(Sep 27 2019 at 16:27)</a>:</h4>
<p>(this is with debug asserts in std off, I think)</p>



<a name="176909399"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176909399" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176909399">(Sep 30 2019 at 07:29)</a>:</h4>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span> There are quite a few methods in <code>DepNode</code> that could be made const fns:</p>
<ul>
<li>can_reconstruct_query_key</li>
<li>is_anon</li>
<li>is_eval_always</li>
<li>has_params</li>
<li>from_def_path_hash (no sure if <code>debug_assert</code> is a problem for const-fn)</li>
<li>new_no_params (ditto)</li>
</ul>



<a name="176909458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176909458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176909458">(Sep 30 2019 at 07:30)</a>:</h4>
<p>That might improve things a little.</p>



<a name="176909624"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187831-t-compiler/wg-self-profile/topic/dumping%20sources%20of%20LLVM%20slowness/near/176909624" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187831-t-compiler/wg-self-profile/topic/dumping.20sources.20of.20LLVM.20slowness.html#176909624">(Sep 30 2019 at 07:34)</a>:</h4>
<p>(because the compiler might be able to "inline" const-fns away before the monomorphizer sees them)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>